var configTemplate = {
    condition: {
        "type": "branch",
        "branchs":
            [
                [
                    {
                        "name": "条件分支",
                        "type": "condition",
                        "approvalAttrubuteData":
                        {
                            "approvalName": "条件分支",
                            "flowType": "condition",
                            "placeholder": "请设置条件",
                            "conditionGroups":
                                [
                                    {
                                        "name": "条件1",
                                        "conditions":
                                            [
                                                {
                                                    "field": "姓名",
                                                    "expression": "等于",
                                                    "target": "李飞飞"
                                                },
                                                {
                                                    "field": "姓名",
                                                    "expression": "等于",
                                                    "target": "李飞飞"
                                                }
                                            ]
                                    }
                                ]
                        },
                        "isDefault": false
                    },
                    {
                        "name": "审批3",
                        "type": "approval",
                        "approvalAttrubuteData":
                        {
                            "approvalName": "审批3",
                            "flowType": "approval",
                            "approvalMethod": "人工审批",
                            "placeholder": "提交人：请选择审批人",
                            "approvalTargets":
                                [
                                    {
                                        "target": "指定成员",
                                        "users":
                                            []
                                    }
                                ],
                            "approverNoExistWhen":
                            {
                                "action": "自动通过"
                            },
                            "approverPresentWhen":
                            {
                                "action": "自动跳过"
                            },
                            "approverMultipleWhen":
                            {
                                "action": "会签"
                            },
                            "ccTargets":
                                []
                        }
                    }
                ],
                [
                    {
                        "name": "默认分支",
                        "type": "condition",
                        "approvalAttrubuteData":
                        {
                            "approvalName": "默认分支",
                            "flowType": "condition",
                            "placeholder": "请设置条件",
                            "conditionGroups":
                                [
                                    {
                                        "name": "条件1",
                                        "conditions":
                                            [
                                                {
                                                    "field": "姓名",
                                                    "expression": "等于",
                                                    "target": "李飞飞"
                                                },
                                                {
                                                    "field": "姓名",
                                                    "expression": "等于",
                                                    "target": "李飞飞"
                                                }
                                            ]
                                    }
                                ]
                        },
                        "isDefault": true
                    },
                    {
                        "name": "审批3",
                        "type": "approval",
                        "approvalAttrubuteData":
                        {
                            "approvalName": "审批3",
                            "flowType": "approval",
                            "approvalMethod": "人工审批",
                            "placeholder": "提交人：请选择审批人",
                            "approvalTargets":
                                [
                                    {
                                        "target": "指定成员",
                                        "users":
                                            []
                                    }
                                ],
                            "approverNoExistWhen":
                            {
                                "action": "自动通过"
                            },
                            "approverPresentWhen":
                            {
                                "action": "自动跳过"
                            },
                            "approverMultipleWhen":
                            {
                                "action": "会签"
                            },
                            "ccTargets":
                                []
                        }
                    }
                ]
            ]
    },
    branch: [
        {
            "name": "半导体",
            "type": "condition",
            "approvalAttrubuteData":
            {
                "approvalName": "半导体",
                "flowType": "condition",
                "placeholder": "请设置条件",
                "conditionGroups":
                    [
                        {
                            "name": "条件1",
                            "conditions":
                                [
                                    {
                                        "field": "收款发生日期",
                                        "expression": "等于",
                                        "target": "审批提交时间"
                                    },
                                    {
                                        "field": "收款发生日期",
                                        "expression": "等于",
                                        "target": "审批提交时间"
                                    },
                                    {
                                        "field": "收款类别",
                                        "expression": "早于",
                                        "target": "审批提交时间"
                                    }
                                ]
                        },
                        {
                            "name": "条件2",
                            "conditions":
                                [
                                    {
                                        "field": "收款发生日期",
                                        "expression": "等于",
                                        "target": "审批提交时间"
                                    },
                                    {
                                        "field": "提交人",
                                        "expression": "晚于",
                                        "target": "审批提交时间"
                                    }
                                ]
                        }
                    ]
            },
            "isDefault": false
        },
        {
            "name": "组长审批",
            "type": "approval",
            "approvalAttrubuteData":
            {
                "approvalName": "组长审批",
                "flowType": "approval",
                "approvalMethod": "人工审批",
                "placeholder": "提交人：请选择审批人",
                "approvalTargets":
                    [
                        {
                            "target": "指定成员",
                            "users":
                                [
                                    "小李"
                                ]
                        }
                    ],
                "approverNoExistWhen":
                {
                    "action": "自动通过"
                },
                "approverPresentWhen":
                {
                    "action": "自动跳过"
                },
                "approverMultipleWhen":
                {
                    "action": "会签"
                },
                "ccTargets":
                    []
            }
        }
    ],
    start: {
        "name": "提交",
        "type": "start",
        "approvalAttrubuteData":
        {
            "approvalName": "提交",
            "placeholder": "请选择提交人",
        }
    },
    approval: {
        "name": "审批",
        "type": "approval",
        "approvalAttrubuteData":
        {
            "approvalName": "审批",
            "flowType": "approval",
            "approvalMethod": "人工审批",
            "placeholder": "提交人：请选择审批人",
            "approvalTargets":
                [
                    {
                        "target": "指定成员",
                        "users":
                            []
                    }
                ],
            "approverNoExistWhen":
            {
                "action": "自动通过"
            },
            "approverPresentWhen":
            {
                "action": "自动跳过"
            },
            "approverMultipleWhen":
            {
                "action": "会签"
            },
            "ccTargets":
                []
        }
    },
    cc: {
        "name": "抄送",
        "type": "cc",
        "approvalAttrubuteData":
        {
            "approvalName": "抄送",
            "flowType": "cc",
            "placeholder": "抄送人：请选择抄送人",
            "ccTargets":
                [
                    {
                        "target": "指定成员",
                        "users":
                            []
                    }
                ]
        }
    },
    end: {
        "name": "结束",
        "type": "end",
        "approvalAttrubuteData":
        {
            "approvalName": "结束",
            "flowType": "end",
            "placeholder": "流程结束"
        }
    }
}

export function getTemplate(type) {
    let template = configTemplate[type];
    let json = JSON.parse(JSON.stringify(template));
    json.id = (new Date().getTime() + "");
    return json;
}